package com.youlu.campus.admin.postage;

import com.youlu.campus.entity.PostageTemplate;
import com.youlu.campus.entity.VO.req.PostageTemplateQueryVO;
import com.youlu.campus.service.postage.PostageTemplateService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class PostageTemplateController {
    @Autowired
    private PostageTemplateService postageTemplateService;

    @PostMapping("/postage-template/list")
    public QResult list(@RequestBody PostageTemplateQueryVO request) {
        return QResult.success(postageTemplateService.list(request));
    }

    @PostMapping("/postage-template/create")
    public QResult list(@RequestBody PostageTemplate request) {
        return QResult.success(postageTemplateService.create(request));
    }

    @PostMapping("/postage-template/update")
    public QResult update(@RequestBody PostageTemplate request) {
        return QResult.success(postageTemplateService.update(request));
    }

    @GetMapping("/postage-template/delete")
    public QResult delete(@RequestParam("id") String id) {
        return QResult.success(postageTemplateService.delete(id));
    }

    @GetMapping("/postage-template/find-one")
    public QResult findOne(@RequestParam("id") String id) {
        return QResult.success(postageTemplateService.findOne(id));
    }
}
